package com.demo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 消息记录表
 *
 * @author zm
 * @since 2020-11-24
 */
@Data
@TableName("pd_message")
@ApiModel(value = "Message对象", description = "消息记录表")
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "消息ID号")
    @TableId(value = "message_id", type = IdType.AUTO)
    private Integer messageId;

    @ApiModelProperty(value = "处理人员ID号")
    @TableField("user_id")
    private Integer userId;

    @TableField(exist = false)
    private String userName;

    @ApiModelProperty(value = "消息来源0.His推送 1.评估 2.其他")
    @TableField("message_source")
    @NotNull(message = "消息来源不能为空")
    private Integer messageSource;

    @ApiModelProperty(value = "消息状态 0未处理1已处理")
    @TableField("message_status")
    private Integer status;

    @ApiModelProperty(value = "消息类型1评估提醒2诊断提醒3处置提醒4医嘱提醒5设备提醒6总结提醒9.复核消息")
    @TableField("message_type")
    @NotNull(message = "消息类型不能为空")
    private Integer messageType;

    @ApiModelProperty(value = "创建人ID号")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "删除时间")
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deletedTime;

    @ApiModelProperty(value = "删除人ID号")
    @TableField("deleted_user_id")
    private Integer deletedUserId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    @ApiModelProperty(value = "更新人ID号")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "消息内容")
    @TableField("message_content")
    @NotBlank(message = "消息内容不能为空")
    private String messageContent;

    @ApiModelProperty(value = "消息对象")
    @TableField("message_target")
    private String messageTarget;

    @ApiModelProperty(value = "处理方式")
    @TableField("message_deal_next")
    private String messageDealNext;

    @ApiModelProperty(value = "处理时间")
    @TableField("message_deal_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date messageDealTime;

    @ApiModelProperty(value = "消息级别")
    @TableField("message_rank")
    private Integer messageRank;

    @ApiModelProperty(value = "消息来源单号")
    @TableField("message_source_sn")
    private String messageSourceSn;

    @ApiModelProperty(value = "发送时间---定时任务")
    @TableField("send_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    @ApiModelProperty(value = "病人ID")
    @TableField("patient_id")
    private Integer patientId;

    @ApiModelProperty("是否循环消息")
    @TableField("message_loop")
    private Integer loop;

    @ApiModelProperty(value = "药物医嘱 id")
    @TableField(value = "doctor_advise_id")
    private Integer doctorAdviseId;

}
